package com.qxbb.report.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qxbb.report.bo.ChainOrderSalerBO;
import com.qxbb.report.bo.QuanterChainSalerBO;
import com.qxbb.report.bo.SalesBO;
import com.qxbb.report.dto.BrandDTO;
import com.qxbb.report.dto.CategoryDTO;
import com.qxbb.report.dto.CategoryDetailDTO;
import com.qxbb.report.dto.CommodityDTO;
import com.qxbb.report.pojo.ChainSalesOrderProduct;
import com.qxbb.report.vo.ProductSalesVO;
import com.qxbb.report.vo.YearAndQuarterVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ChainSalesOrderProductMapper extends BaseMapper<ChainSalesOrderProduct> {


    /**
     * 查询该店铺具体时间段内所有年度季节的销售记录
     * @param chainOrderSalerBO
     * @return
     */
    List<Integer> selectYear(ChainOrderSalerBO chainOrderSalerBO);

    /**
     * 查询该店铺具体时间段内所有年度季节的销售记录
     * @param quanterChainSalerBO
     * @return
     */
    List<Integer> selectQuarter(QuanterChainSalerBO quanterChainSalerBO);

    /**
     * 查询商品类别销售详情
     *
     * @param salesBO
     * @return
     */
    List<ProductSalesVO> selectProductSales(@Param("salesBO") SalesBO salesBO);

    /**
     * 查询该年份季度下有那些品牌
     *
     * @param year
     * @param quarter
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<Integer> selectByBrand(Integer year, Integer quarter, Integer chainStore, Integer handledBy,String startTime,String endTime);

    /**
     * 查询品牌销售详情
     *
     * @param year
     * @param quarter
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<BrandDTO> selectBrandDto(@Param("year") Integer year, @Param("quarter") Integer quarter,
                                  @Param("chainStore") List<Integer> chainStore, @Param("handledBy") Integer handledBy,@Param("startTime") String startTime,@Param("endTime") String endTime);



    /**
     * 查询该品牌下有那些商品
     *
     * @param
     * @return
     */
    List<Integer> selectByProduct(@Param("year") Integer year, @Param("quarter") Integer quarter, @Param("chainStore") Integer chainStore,
                                 @Param("handledBy") Integer handledBy, @Param("brandId") Integer brandId,@Param("startTime") String startTime,@Param("endTime") String endTime);

    /**
     * 查询品牌下某商品信息
     *
     * @param year
     * @param quarter
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<CommodityDTO> selectCommodityDto(@Param("year") Integer year, @Param("quarter") Integer quarter, @Param("brandId") Integer brandId,
                                           @Param("chainStore") List<Integer> chainStore,@Param("handledBy") Integer handledBy,
                                          @Param("startTime") String startTime,@Param("endTime") String endTime);


    /**
     * 季度查询
     * @param salesBO
     * @return
     */
    List<ProductSalesVO> selectProductQuanter(@Param("salesBO") SalesBO salesBO);

    /**
     * 查询该年份季度下有那些品牌
     *
     * @param year
     * @param quarter
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<Integer> selectByCategoryIds(Integer year, Integer quarter, Integer chainStore, Integer handledBy,String startTime,String endTime);

    /**
     * 查询品牌销售详情
     *
     * @param year
     * @param quarter
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<CategoryDTO> selectCategoryDto(Integer year, Integer quarter,  List<Integer> chainStore, Integer handledBy,String startTime,String endTime);



    /**
     * 查询类别销售详情
     *
     * @param year
     * @param quarter
     * @param categoryId
     * @param chainStore
     * @param handledBy
     * @return
     */
    List<CategoryDetailDTO> selectCategoryDetailDTO(Integer year, Integer quarter, Integer categoryId,List<Integer> chainStore, Integer handledBy,String startTime,String endTime);


}
